home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / e / ddmoduls.lha / dd_Modules / dd_gui / dd_onlinehelptest.e < prev    next >
Text File  |  1995-08-13  |  1KB  |  48 lines

  1. MODULE '*dd_onlinehelp'
  2. MODULE 'dos/dos'
  3.  
  4. PROC main()
  5.   DEF help:PTR TO onlinehelp
  6.   DEF signals
  7.  
  8.   NEW help.new('dd_onlinehelptest2.guide','ONLINEHELPTEST_HELP','OnlineHelpTest',['main','node1','node2',0])
  9.  
  10.   PrintF('Use CTRL-D and CTRL-E to simulate user contexts. See doc.\n')
  11.   PrintF('Use CTRL-F to call for help, CTRL-C to quit.\n')
  12.  
  13.   -> main program loop
  14.   WHILE TRUE
  15.     -> wait for user input
  16.     signals:=Wait(help.signalmask OR
  17.                   SIGBREAKF_CTRL_C OR
  18.                   SIGBREAKF_CTRL_D OR
  19.                   SIGBREAKF_CTRL_E OR
  20.                   SIGBREAKF_CTRL_F)
  21.  
  22.     -> handle arrived guide messages
  23.     IF signals AND help.signalmask THEN help.handle()
  24.  
  25.     -> Ctrl-D is a 'user context' here. In full blown applications, this
  26.     -> is actually the user activating a window etc. See docs.
  27.     IF signals AND SIGBREAKF_CTRL_D
  28.       help.setcontext(1)
  29.     ENDIF
  30.  
  31.     -> Ctrl-E is another 'user context' here.
  32.     IF signals AND SIGBREAKF_CTRL_E
  33.       help.setcontext(2)
  34.     ENDIF
  35.  
  36.     -> Ctrl-F calls for help, and thus simulates the HELP key here
  37.     IF signals AND SIGBREAKF_CTRL_F
  38.       -> this should be called when the user pressed 'help' or similar
  39.       help.help()
  40.     ENDIF
  41.  
  42.     -> Ctrl-C quits
  43.     EXIT (signals AND SIGBREAKF_CTRL_C)
  44.   ENDWHILE
  45.   help.close()
  46.   END help
  47. ENDPROC
  48.